<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>大卫杜夫 | 雪茄</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="shortcut icon" type="image/ico" href="http://davidoff.com/favicon.ico" />
	<link href="../static/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="../static/dist/css/swiper.min.css">
	<link href="../static/css/reset.css" rel="stylesheet">
	<link href="../static/css/main.css" rel="stylesheet">
	<link href="../static/css/en.css" rel="stylesheet">
</head>

<body>
	<div id="header"></div>
	<div class="page_wrapper">
		<section id="page-toolbar" class="cigars" style="margin-bottom:10px">
			<a href="javascript:history.go(-1)" class="bread"><span>返回</span></a>
		</section>
		<!-- row start -->
		<div id="wp">
		</div>
		<script id="tpl" type="text/html">
			<section id="product" class="margin-bottom-80">
				<div id="visual">
							<!-- Swiper -->
					<div class="swiper-container gallery-top">
							<div class="swiper-wrapper">
									<%for(var i = 0; i< list.IMG_URL.length; i++) {%>
									<div class="swiper-slide"><img src="<%:=list.IMG_URL[i]%>"> </div>
									<%}%>
							</div>
							<!-- Add Arrows -->
						</div>
						<div class="swiper-container gallery-thumbs">
								<div class="swiper-wrapper">
										<%for(var j = 0; j < list.IMG_URL.length; j++) {%>
									<div class="swiper-slide"><img src="<%:=list.IMG_URL[j]%>"></div>
									<%}%>
								</div>
							</div>
								<!-- Swiper end -->
					<div class="cta-bar">
						<ul id="social-links" class="clearfix">
							<li class="label">分享</li>
							<li class="icons">
								<div class="icons-wrapper">
									<a class="button popup icon external facebook" href="https://www.facebook.com/sharer/sharer.php?u=http://davidoff.com/cigars/primeros-dominican-nicaragua">
										<div class="icon" data-type="Facebook"></div>
									</a>
									<a class="button popup icon external twitter" href="http://twitter.com/intent/tweet?url=http://davidoff.com/cigars/primeros-dominican-nicaragua&amp;via=Davidoff_Cigars&amp;text=Primeros by Davidoff Nicaragua">
										<div class="icon" data-type="Twitter"></div>
									</a>
									<a class="button popup icon external pin" href="http://pinterest.com/pin/create/button/?url=http://davidoff.com/cigars/primeros-dominican-nicaragua&amp;media=http://davidoff.com/images/cigars/cig_prim_nicaragua_sgl.jpg"
									 style="text-decoration:none;">
										<div class="icon" data-type="Pinterest"></div>
									</a>
									<a class="button popup icon email" href="mailto:?subject=Davidoff.com - Primeros by Davidoff Nicaragua&amp;body=http://davidoff.com/cigars/primeros-dominican-nicaragua">
										<div class="icon" data-type="Email"></div>
									</a></div>
							</li>
						</ul>
					</div>
					</div>
				</div>
			</div>
				<div id="info">
					<h3 class="desktop"><%:=list.PD_TYPE_NAME%></h3>
					<h2 class="desktop"><%:=list.PRODUCT_NAME%></h2>
					<p class="body">
							<%:=list.PRODUCT_NAME%>
					</p>
					<span class="mobile-title">Specifics</span>
					<div class="table-wrapper">
						<ul>
								<%if(list.STRENGTH) {%>
							<li class="filters pad strength">
								<div class="value"><%:=list.STRENGTH%></div>
								<div class="label">强度</div>
							</li>
							<%}%>
							<%if(list.FMT) {%>
							<li class="filters">
								<div class="value"><%:=list.FMT%></div>
								<div class="label">品型</div>
							</li>
							<%}%>
						</ul>
						<%if(list.PROVEN) {%>
						<ul>
							<li class="filters">
								<div class="value"><%:=list.PROVEN%></div>
								<div class="label">种源</div>
							</li>
						</ul>
						<%}%>
						<ul>	<%if(list.LENG) {%>
							<li class="filters pad">
								<div class="value"><%:=list.LENG%></div>
								<div class="label">长度</div>
							</li>
							<%}%>
							<%if(list.RING) {%>
							<li class="filters">
								<div class="value hide-style"><%:=list.RING%></div>
								<div class="label">直径</div>
							</li><%}%>
						</ul>
						<%if(list.ENJOYMENT) {%>
						<ul>
							<li class="filters">
								<div class="value"><%:=list.ENJOYMENT%></div>
								<div class="label">享用时间</div>
							</li>
						</ul>
						<%}%>
					</div>
					<a href="../map/index.html" style="margin-top: 20px;" class="btn--gold js-trackProduct" data-product="Primeros by Davidoff Nicaragua"
					 data-action="Find a shop">临近店铺</a>
					<div class="cta-bar-mobile">
						<ul id="social-links" class="clearfix">
							<li class="label">Share</li>
							<li class="icons">
								<div class="icons-wrapper">
									<a class="button popup icon external facebook" href="https://www.facebook.com/sharer/sharer.php?u=http://davidoff.com/cigars/primeros-dominican-nicaragua">
										<div class="icon" data-type="Facebook"></div>
									</a>
									<a class="button popup icon external twitter" href="http://twitter.com/intent/tweet?url=http://davidoff.com/cigars/primeros-dominican-nicaragua&amp;via=Davidoff_Cigars&amp;text=Primeros by Davidoff Nicaragua">
										<div class="icon" data-type="Twitter"></div>
									</a>
									<a class="button popup icon external pin" href="http://pinterest.com/pin/create/button/?url=http://davidoff.com/cigars/primeros-dominican-nicaragua&amp;media=http://davidoff.com/images/cigars/cig_prim_nicaragua_sgl.jpg"
									 style="text-decoration:none;">
										<div class="icon" data-type="Pinterest"></div>
									</a>
									<a class="button popup icon email" href="mailto:?subject=Davidoff.com - Primeros by Davidoff Nicaragua&amp;body=http://davidoff.com/cigars/primeros-dominican-nicaragua">
										<div class="icon" data-type="Email"></div>
									</a></div>
							</li>
						</ul>
					</div>
				</div>
			</section>
		</script>
		<!-- 评分 -->
		<section id="reviews" class="margin-bottom-40">
			<div id="score_wp">
			</div>
			<script id="score_tpl" type="text/html">
				<%if(scoreList.length>0) {%><header class="section-header margin-bottom-40">
				 <h2 class="caps">评分</h2>
				</header>
				<%}%>
				<%for(var i = 0; i < scoreList.length; i++) {%>
				<div class="item score">
					<span class="number"><%:=scoreList[i].EVAL_SCORE%>
					</span>
					<p class="body"><%:=scoreList[i].EVAL_DETAIL%>
					</p>
					<a href="<%:=scoreList[i].EVAL_LINK%>" target="_blank"><span class="source">查看详情 ></span></a>
				</div>
				<%}%>
			</script>
		</section>
		<!-- 您可能喜欢 -->
		<section id="related">
			<div id="love_wp">
			</div>
			<!-- Related Accessories -->
			<script id="love_tpl" type="text/html">
				<%if(loveList.length>0) {%><header class="section-header margin-bottom-40">
				<h2 class="caps">您可能喜欢</h2>
				</header><%}%>
				<%for(var j = 0; j < loveList.length; j++) {%>
				<%if(j==0) {%>
			<div class="item two">
					<%}%>
					<%if(j==1) {%>
						<div class="item one">
					<%}%>
					<%if(j==2) {%>
					<div class="item three">
					<%}%>
					<%if(loveList[j].BIG_CLASS=="配件") {%>
				  <a href="/accessories/detail.html?PRODUCT_ID=<%:=loveList[j].PRODUCT_ID%>">
					<%}else{%>
					<a href="/cigars/detail.html?PRODUCT_ID=<%:=loveList[j].PRODUCT_ID%>">
					<%}%>
					<div class="image-wrapper"><img src="<%:=JSON.parse(loveList[j].IMG_URL)[0]%>"
						 alt="<%:=loveList[j].PRODUCT_NAME%>"></div>
					<h3><%:=loveList[j].PRODUCT_NAME%></h3>
				</a>
			</div>
			<%}%>
		</script>
		</section>

	</div>
	<!-- row end -->
	<!--footer start  -->
	<!--footer end  -->
	<div id="footer"></div>
	<script type="text/javascript" src="../static/lib/fancyBox-2.1.5/lib/jquery-1.10.1.min.js"></script>
	<script src="../static/lib/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="../static/js/common.js"></script>
	<script src="../static/js/template.js"></script>
	<!-- Swiper JS -->
	<script src="../static/dist/js/swiper.min.js"></script>
	<script>
		var ProductInfo;

		function showScore() {
			var tpl = document.getElementById('score_tpl').innerHTML;
			ProductInfo.EVAL_DETAIL = JSON.parse(ProductInfo.EVAL_DETAIL)
			var html = template(tpl, {
				scoreList: ProductInfo.EVAL_DETAIL
			});
			document.getElementById('score_wp').innerHTML = html;
		}

		function showLovePrd() {
			var tpl = document.getElementById('love_tpl').innerHTML;
			ProductInfo.LOVE_PRODUCTS = JSON.parse(ProductInfo.LOVE_PRODUCTS)
			var html = template(tpl, {
				loveList: ProductInfo.LOVE_PRODUCTS
			});
			document.getElementById('love_wp').innerHTML = html;
		}
		$(function () {
			let params = {
				"cmd": "product.get",
				"param": {
					"PRODUCT_ID": getUrlParam('PRODUCT_ID')
				}
			}
			$.ajax({
				type: "POST",
				url: "http://davidoff.gemdesign.cn/CMS/api/CMS",
				contentType: "application/json; charset=utf-8",
				data: JSON.stringify(params),
				dataType: "json",
				success: function (data) {
					ProductInfo = data.ProductInfo
					var tpl = document.getElementById('tpl').innerHTML;
					ProductInfo.IMG_URL = JSON.parse(ProductInfo.IMG_URL)
					var html = template(tpl, {
						list: ProductInfo
					});
					document.getElementById('wp').innerHTML = html;
					//显示评分
					showScore()
					//显示关联产品
					showLovePrd()
					var galleryThumbs = new Swiper('.gallery-thumbs', {
						spaceBetween: 10,
						slidesPerView: 4,
						freeMode: true,
						watchSlidesVisibility: true,
						watchSlidesProgress: true,
					});
					var galleryTop = new Swiper('.gallery-top', {
						spaceBetween: 10,
						navigation: {
							nextEl: '.swiper-button-next',
							prevEl: '.swiper-button-prev',
						},
						thumbs: {
							swiper: galleryThumbs
						}
					});
				},
				error: function (message) {
					alert(message)
				}
			});
		});

	</script>
</body>

</html>
